package rm3;

import java.net.DatagramSocket;
import java.net.SocketException;


import server.ServerImpl;

public class RMHoldBack 
{
	public static void main(String [] args) throws SocketException{
		
		System.out.println("Starting replica 3...");
		ServerImpl montreal = new ServerImpl("Montreal");
		ServerImpl toronto = new ServerImpl("Toronto");
		ServerImpl vancouver = new ServerImpl("Vancouver");

		montreal. startServerSocket();
		toronto.startServerSocket();
		vancouver.startServerSocket();

		UDPManagerListener rm1Manager = null;
		try {
			 rm1Manager = new UDPManagerListener(new DatagramSocket(61102), montreal, toronto, vancouver);
		} catch (SocketException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		rm1Manager.start();
		
		ReliableUDPListener rm3 = null;
		try {
			rm3 = new ReliableUDPListener(new DatagramSocket(61002), montreal, vancouver, toronto);
			
		} catch (SocketException e) {

			e.printStackTrace();
		}
		rm3.run();
	}
}
